package spring.cloud.tasks.executor.task_type;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.executor.task.TaskExecuteEngine;
import spring.cloud.tasks.executor.trigger.Trigger;

@Slf4j
@Setter
@Getter
public class TaskTypeImpl implements TaskType {

    private String name;
    private Class<? extends Trigger> triggerClass;
    private Class<? extends TaskExecuteEngine> handlerClass;

    private boolean isCron;
    private boolean isPassive;


    private boolean isAllowedShutdownGracefully;

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Class<? extends Trigger> getTriggerClass() {
        return triggerClass;
    }

    public void setTriggerClass(Class<? extends Trigger> triggerClass) {
        this.triggerClass = triggerClass;
    }

    @Override
    public Class<? extends TaskExecuteEngine> getHandlerClass() {
        return handlerClass;
    }

    public void setHandlerClass(Class<? extends TaskExecuteEngine> handlerClass) {
        this.handlerClass = handlerClass;
    }

    @Override
    public boolean isCron() {
        return isCron;
    }

    public void setCron(boolean cron) {
        isCron = cron;
    }

    @Override
    public boolean isPassive() {
        return isPassive;
    }

    public void setPassive(boolean passive) {
        isPassive = passive;
    }


    @Override
    public boolean isAllowedShutdownGracefully() {
        return isAllowedShutdownGracefully;
    }

    public void setAllowedShutdownGracefully(boolean allowedShutdownGracefully) {
        isAllowedShutdownGracefully = allowedShutdownGracefully;
    }
}
